package com.bf.electroplating.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 企业排污阀监测数据表
 *
 * @author system
 * @since 2025-10-09
 */
@Getter
@Setter
@TableName("enterprise_outfall_valve")
@Schema(description = "企业排污阀监测数据表")
public class EnterpriseOutfallValve implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @TableId("ID")
    private String id;

    @Schema(description = "企业ID")
    @TableField("COMPANY_ID")
    private String companyId;

    @Schema(description = "企业名称")
    @TableField("COMPANY_NAME")
    private String companyName;

    @Schema(description = "园区ID")
    @TableField("PARK_ID")
    private String parkId;

    @Schema(description = "排污口ID")
    @TableField("OUTFALL_ID")
    private String outfallId;

    @Schema(description = "设备名称")
    @TableField("DEVICE_NAME")
    private String deviceName;

    @Schema(description = "设备编码")
    @TableField("DEVICE_CODE")
    private String deviceCode;

    @Schema(description = "MN码（HJ212设备唯一标识）")
    @TableField("MN_CODE")
    private String mnCode;

    @Schema(description = "设备类型：OUTFALL-排污阀,EMERGENCY-应急阀,RAIN-雨排阀")
    @TableField("DEVICE_TYPE")
    private String deviceType;

    @Schema(description = "安装位置")
    @TableField("INSTALL_LOCATION")
    private String installLocation;

    @Schema(description = "安装日期")
    @TableField("INSTALL_DATE")
    private LocalDateTime installDate;

    // ==================== 阀门状态监测 ====================
    @Schema(description = "阀门状态：OPEN-开启,CLOSE-关闭,OPENING-开启中,CLOSING-关闭中,FAULT-故障")
    @TableField("VALVE_STATUS")
    private String valveStatus;

    @Schema(description = "阀门状态标志位：N-正常,F-故障,M-维护,B-缺失")
    @TableField("VALVE_STATUS_FLAG")
    private String valveStatusFlag;

    @Schema(description = "阀门开度（%，0-100）")
    @TableField("VALVE_OPENING")
    private BigDecimal valveOpening;

    @Schema(description = "阀门开度标志位")
    @TableField("VALVE_OPENING_FLAG")
    private String valveOpeningFlag;

    // ==================== 流量监测（Min/Max/Avg/Cou/Flag） ====================
    @Schema(description = "流量最小值(m³/h)")
    @TableField("FLOW_RATE_MIN")
    private BigDecimal flowRateMin;

    @Schema(description = "流量最大值(m³/h)")
    @TableField("FLOW_RATE_MAX")
    private BigDecimal flowRateMax;

    @Schema(description = "流量平均值(m³/h)")
    @TableField("FLOW_RATE_AVG")
    private BigDecimal flowRateAvg;

    @Schema(description = "流量累积值(m³)")
    @TableField("FLOW_RATE_COU")
    private BigDecimal flowRateCou;

    @Schema(description = "流量标志位")
    @TableField("FLOW_RATE_FLAG")
    private String flowRateFlag;

    // ==================== 液位监测 ====================
    @Schema(description = "液位最小值(m)")
    @TableField("POOL_LEVEL_MIN")
    private BigDecimal poolLevelMin;

    @Schema(description = "液位最大值(m)")
    @TableField("POOL_LEVEL_MAX")
    private BigDecimal poolLevelMax;

    @Schema(description = "液位平均值(m)")
    @TableField("POOL_LEVEL_AVG")
    private BigDecimal poolLevelAvg;

    @Schema(description = "液位标志位")
    @TableField("POOL_LEVEL_FLAG")
    private String poolLevelFlag;

    // ==================== PH值监测 ====================
    @Schema(description = "PH最小值")
    @TableField("PH_MIN")
    private BigDecimal phMin;

    @Schema(description = "PH最大值")
    @TableField("PH_MAX")
    private BigDecimal phMax;

    @Schema(description = "PH平均值")
    @TableField("PH_AVG")
    private BigDecimal phAvg;

    @Schema(description = "PH标志位")
    @TableField("PH_FLAG")
    private String phFlag;

    // ==================== COD监测 ====================
    @Schema(description = "COD最小值(mg/L)")
    @TableField("COD_MIN")
    private BigDecimal codMin;

    @Schema(description = "COD最大值(mg/L)")
    @TableField("COD_MAX")
    private BigDecimal codMax;

    @Schema(description = "COD平均值(mg/L)")
    @TableField("COD_AVG")
    private BigDecimal codAvg;

    @Schema(description = "COD标志位")
    @TableField("COD_FLAG")
    private String codFlag;

    // ==================== 电导率监测 ====================
    @Schema(description = "电导率最小值(μS/cm)")
    @TableField("CONDUCTIVITY_MIN")
    private BigDecimal conductivityMin;

    @Schema(description = "电导率最大值(μS/cm)")
    @TableField("CONDUCTIVITY_MAX")
    private BigDecimal conductivityMax;

    @Schema(description = "电导率平均值(μS/cm)")
    @TableField("CONDUCTIVITY_AVG")
    private BigDecimal conductivityAvg;

    @Schema(description = "电导率标志位")
    @TableField("CONDUCTIVITY_FLAG")
    private String conductivityFlag;

    // ==================== 氨氮（w21003）相关字段 ====================
    @Schema(description = "氨氮最小值(mg/L)")
    @TableField("ammonia_nitrogen_min")
    private BigDecimal ammoniaNitrogenMin;

    @Schema(description = "氨氮最大值(mg/L)")
    @TableField("ammonia_nitrogen_max")
    private BigDecimal ammoniaNitrogenMax;

    @Schema(description = "氨氮平均值(mg/L)")
    @TableField("ammonia_nitrogen_avg")
    private BigDecimal ammoniaNitrogenAvg;

    @Schema(description = "氨氮累积值")
    @TableField("ammonia_nitrogen_cou")
    private BigDecimal ammoniaNitrogenCou;

    @Schema(description = "氨氮标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("ammonia_nitrogen_flag")
    private String ammoniaNitrogenFlag;

    // ==================== 总磷（w21011）相关字段 ====================
    @Schema(description = "总磷最小值(mg/L)")
    @TableField("total_phosphorus_min")
    private BigDecimal totalPhosphorusMin;

    @Schema(description = "总磷最大值(mg/L)")
    @TableField("total_phosphorus_max")
    private BigDecimal totalPhosphorusMax;

    @Schema(description = "总磷平均值(mg/L)")
    @TableField("total_phosphorus_avg")
    private BigDecimal totalPhosphorusAvg;

    @Schema(description = "总磷累积值")
    @TableField("total_phosphorus_cou")
    private BigDecimal totalPhosphorusCou;

    @Schema(description = "总磷标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_phosphorus_flag")
    private String totalPhosphorusFlag;

    // ==================== 总氮（w21002）相关字段 ====================
    @Schema(description = "总氮最小值(mg/L)")
    @TableField("total_nitrogen_min")
    private BigDecimal totalNitrogenMin;

    @Schema(description = "总氮最大值(mg/L)")
    @TableField("total_nitrogen_max")
    private BigDecimal totalNitrogenMax;

    @Schema(description = "总氮平均值(mg/L)")
    @TableField("total_nitrogen_avg")
    private BigDecimal totalNitrogenAvg;

    @Schema(description = "总氮累积值")
    @TableField("total_nitrogen_cou")
    private BigDecimal totalNitrogenCou;

    @Schema(description = "总氮标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_nitrogen_flag")
    private String totalNitrogenFlag;

    // ==================== 总铜（w20122）相关字段 ====================
    @Schema(description = "总铜最小值(mg/L)")
    @TableField("total_copper_min")
    private BigDecimal totalCopperMin;

    @Schema(description = "总铜最大值(mg/L)")
    @TableField("total_copper_max")
    private BigDecimal totalCopperMax;

    @Schema(description = "总铜平均值(mg/L)")
    @TableField("total_copper_avg")
    private BigDecimal totalCopperAvg;

    @Schema(description = "总铜累积值")
    @TableField("total_copper_cou")
    private BigDecimal totalCopperCou;

    @Schema(description = "总铜标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_copper_flag")
    private String totalCopperFlag;

    // ==================== 总铬（w20125）相关字段 ====================
    @Schema(description = "总铬最小值(mg/L)")
    @TableField("total_chromium_min")
    private BigDecimal totalChromiumMin;

    @Schema(description = "总铬最大值(mg/L)")
    @TableField("total_chromium_max")
    private BigDecimal totalChromiumMax;

    @Schema(description = "总铬平均值(mg/L)")
    @TableField("total_chromium_avg")
    private BigDecimal totalChromiumAvg;

    @Schema(description = "总铬累积值")
    @TableField("total_chromium_cou")
    private BigDecimal totalChromiumCou;

    @Schema(description = "总铬标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_chromium_flag")
    private String totalChromiumFlag;

    // ==================== 总锌（w20123）相关字段 ====================
    @Schema(description = "总锌最小值(mg/L)")
    @TableField("total_zinc_min")
    private BigDecimal totalZincMin;

    @Schema(description = "总锌最大值(mg/L)")
    @TableField("total_zinc_max")
    private BigDecimal totalZincMax;

    @Schema(description = "总锌平均值(mg/L)")
    @TableField("total_zinc_avg")
    private BigDecimal totalZincAvg;

    @Schema(description = "总锌累积值")
    @TableField("total_zinc_cou")
    private BigDecimal totalZincCou;

    @Schema(description = "总锌标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_zinc_flag")
    private String totalZincFlag;

    // ==================== 总镍（w20121）相关字段 ====================
    @Schema(description = "总镍最小值(mg/L)")
    @TableField("total_nickel_min")
    private BigDecimal totalNickelMin;

    @Schema(description = "总镍最大值(mg/L)")
    @TableField("total_nickel_max")
    private BigDecimal totalNickelMax;

    @Schema(description = "总镍平均值(mg/L)")
    @TableField("total_nickel_avg")
    private BigDecimal totalNickelAvg;

    @Schema(description = "总镍累积值")
    @TableField("total_nickel_cou")
    private BigDecimal totalNickelCou;

    @Schema(description = "总镍标志位：N-正常,D-双信号,C-修正,S-停运,M-维护,F-故障,B-缺失,T-调试")
    @TableField("total_nickel_flag")
    private String totalNickelFlag;



    // ==================== 远程控制指令 ====================
    @Schema(description = "远控状态：ENABLED-已启用,DISABLED-已禁用")
    @TableField("REMOTE_CONTROL_STATUS")
    private String remoteControlStatus;

    @Schema(description = "远控开启指令")
    @TableField("REMOTE_OPEN_CMD")
    private String remoteOpenCmd;

    @Schema(description = "远控关闭指令")
    @TableField("REMOTE_CLOSE_CMD")
    private String remoteCloseCmd;

    @Schema(description = "阀门开启指令")
    @TableField("VALVE_OPEN_CMD")
    private String valveOpenCmd;

    @Schema(description = "阀门开启结束指令")
    @TableField("VALVE_OPEN_END_CMD")
    private String valveOpenEndCmd;

    @Schema(description = "阀门关闭指令")
    @TableField("VALVE_CLOSE_CMD")
    private String valveCloseCmd;

    @Schema(description = "阀门关闭结束指令")
    @TableField("VALVE_CLOSE_END_CMD")
    private String valveCloseEndCmd;

    @Schema(description = "最后发送的指令")
    @TableField("LAST_CMD")
    private String lastCmd;

    @Schema(description = "最后指令类型：OPEN-开启,CLOSE-关闭")
    @TableField("LAST_CMD_TYPE")
    private String lastCmdType;

    @Schema(description = "指令发送时间")
    @TableField("CMD_SEND_TIME")
    private LocalDateTime cmdSendTime;

    @Schema(description = "指令响应时间")
    @TableField("CMD_RESPONSE_TIME")
    private LocalDateTime cmdResponseTime;

    @Schema(description = "指令执行结果：SUCCESS-成功,FAILED-失败,TIMEOUT-超时")
    @TableField("CMD_RESULT")
    private String cmdResult;

    // ==================== 时间信息 ====================
    @Schema(description = "监测时间（数据时间）")
    @TableField("MONITORING_TIME")
    private LocalDateTime monitoringTime;

    @Schema(description = "数据时间（HJ212协议DataTime）")
    @TableField("DATA_TIME")
    private LocalDateTime dataTime;

    // ==================== 状态与标记 ====================
    @Schema(description = "在线状态：ONLINE-在线,OFFLINE-离线")
    @TableField("ONLINE_STATUS")
    private String onlineStatus;

    @Schema(description = "告警状态：NORMAL-正常,ALARM-告警")
    @TableField("ALARM_STATUS")
    private String alarmStatus;

    @Schema(description = "告警类型：多个用逗号分隔")
    @TableField("ALARM_TYPE")
    private String alarmType;

    @Schema(description = "启用状态：1-启用,0-停用")
    @TableField("STATUS")
    private String status;

    @Schema(description = "逻辑删除：0-正常,1-删除")
    @TableField("DEL_FLAG")
    private String delFlag;

    // ==================== 系统字段 ====================
    @Schema(description = "创建人")
    @TableField("CREATE_BY")
    private String createBy;

    @Schema(description = "创建时间")
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    @Schema(description = "修改人")
    @TableField("UPDATE_BY")
    private String updateBy;

    @Schema(description = "修改时间")
    @TableField("UPDATE_TIME")
    private LocalDateTime updateTime;

    @Schema(description = "备注")
    @TableField("REMARK")
    private String remark;
}

